<template>
  <div class="app-container home">
    <el-row :gutter="10">
      <el-col :span="12">
        <el-card>
          <div slot="header" class="clearfix">
            <span>接口访问量</span>
          </div>
          <lineChart class="echartBox" :xData="registerData.xData" :data="registerData.data" :text="registerData.text" :show="registerData.show" yName="单位：次"></lineChart>
        </el-card>
      </el-col>
      <el-col :span="12">
        <el-card>
          <div slot="header" class="clearfix">
            <span>服务方数量及费用统计</span>
          </div>
          <lineChart class="echartBox" :xData="premium.xData" :data="premium.data" :text="premium.text" :show="premium.show" yName="单位：万元"></lineChart>
        </el-card>
      </el-col>
      <el-col :span="12" class="mt-10">
        <el-card>
          <div slot="header" class="clearfix">
            <span>接口数量统计</span>
          </div>
          <lineChart class="echartBox" chartType="bar" :xData="guaranteeSlip.xData" :data="guaranteeSlip.data" :text="guaranteeSlip.text" :show="guaranteeSlip.show" yName="单位：单"></lineChart>
        </el-card>
      </el-col>
      <el-col :span="12" class="mt-10">
        <el-card>
          <div slot="header" class="clearfix">
            <span>XXXX统计</span>
          </div>
          <pieChart class="echartBox" :chartData="chartData"></pieChart>
        </el-card>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import lineChart from '@/components/echarts/lineChart'
import pieChart from '@/components/echarts/pieChart'
export default {
  name: 'Index',
  components: {
    lineChart,
    pieChart
  },
  data() {
    return {
      // 版本号
      version: '3.8.2',
      registerData: {
        show: true,
        text: '最近一周接口请求量',
        xData: ['10', '11', '12', '13', '14', '15', '16'],
        data: ['1000', '1120', '2012', '1300', '1204', '5415', '1566']
      },
      premium: {
        show: true,
        text: '每月XXX统计',
        xData: ['1月', '2月', '3月', '4月', '5月'],
        data: [20, 25, 31, 12, 24]
      },
      guaranteeSlip: {
        show: true,
        text: 'XXXXX数量统计',
        xData: ['1月', '2月', '3月', '4月', '5月'],
        data: [152, 256, 365, 214, 152]
      },
      chartData: [
        { name: 'AAAAA', value: 25 },
        { name: 'BBBBB', value: 26 },
        { name: 'CCCCC', value: 56 },
        { name: 'DDDDD', value: 46 },
        { name: 'EEEEE', value: 16 },
        { name: 'FFFFF', value: 6 }
      ]
    }
  }
}
</script>

<style scoped lang="scss">
.home {
  blockquote {
    padding: 10px 20px;
    margin: 0 0 20px;
    font-size: 17.5px;
    border-left: 5px solid #eee;
  }
  hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
  }
  .col-item {
    margin-bottom: 20px;
  }

  ul {
    padding: 0;
    margin: 0;
  }

  font-family: 'open sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #676a6c;
  overflow-x: hidden;

  ul {
    list-style-type: none;
  }

  h4 {
    margin-top: 0px;
  }

  h2 {
    margin-top: 10px;
    font-size: 26px;
    font-weight: 100;
  }

  p {
    margin-top: 10px;

    b {
      font-weight: 700;
    }
  }

  .update-log {
    ol {
      display: block;
      list-style-type: decimal;
      margin-block-start: 1em;
      margin-block-end: 1em;
      margin-inline-start: 0;
      margin-inline-end: 0;
      padding-inline-start: 40px;
    }
  }
}

.echartBox {
  height: 280px;
}
</style>

